package cn.openea.perpartner.payment.web.points.controller;

import cn.openea.perpartner.common.core.web.controller.BaseController;
import cn.openea.perpartner.common.core.web.domain.AjaxResult;
import cn.openea.perpartner.payment.web.points.dto.TokenVo;
import cn.openea.perpartner.payment.web.points.service.IValidateService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * @author Weird077
 * @description TODO
 * @date 2022-11-17 17:34
 */
@Api(tags = "积分系统")
@RestController
@RequestMapping("/points/token")
public class ValidateController extends BaseController {

    @Resource
    private IValidateService validateService;

    @ApiOperation("生成token")
    @PostMapping
    public AjaxResult createToken(@RequestBody TokenVo vo) {
        String token = validateService.createToken(vo);
        return AjaxResult.success("操作成功！", token);
    }
}

